import uviewPlus, { setConfig } from 'uview-plus'
import { createSSRApp } from 'vue'
import App from './App.vue'
import store from './store/index'

// import GNoData from "@/pages/healthPortrait/detail.vue";// 1.引入组件
import slideRule from "@/pages/healthPortrait/components/slideRule.vue";// 1.引入组件
import slideRuleBlood from "@/pages/healthPortrait/components/slideRuleBlood.vue";// 1.引入组件
import Calipers from "@/components/Calipers.vue";// 1.引入组件

export function createApp() {
    const app = createSSRApp(App)
    // app.component("g-no-data", GNoData); // 2. 注册后  直接在代码中  <g-no-data></g-no-data>
    app.component("slideRule", slideRule);
    app.component("slideRuleBlood", slideRuleBlood);
    app.component("Calipers", Calipers);
    app.use(store)
    app.use(uviewPlus)
    // app.use(slideRule)

    setConfig({
        // 修改$u.config对象的属性
        config: {
            // 修改默认单位为rpx，相当于执行 uni.$u.config.unit = 'rpx'
            unit: 'rpx'
        }
    })

    return {
        app
    }
}
